package com.yimi.yinhepda.base;

import android.os.Bundle;
import android.view.View;

import butterknife.ButterKnife;

import com.pda.ym.base.BaseActivity;
import com.yimi.yinhepda.utils.Common;

/**
 * @author 000432
 */
public abstract class BaseInitActivity extends BaseActivity {

    public BaseInitActivity() {
        super(false);
    }

    public BaseInitActivity(boolean isScan) {
        super(isScan);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentViewId());
        //view注入
        ButterKnife.bind(this);

        initView(savedInstanceState);
        initEvent();
        initData();
    }

    protected void onClickBtn(View v){
        Common.specificSetting(this);
    }

    /**
     * 当前窗的viewId
     */
    public abstract int getContentViewId();

    /**
     * 初始化view
     */
    public abstract void initView(Bundle savedInstanceState);

    /**
     * 初始化event，例如监听等
     */
    public abstract void initEvent();

    /**
     * 初始化数据
     */
    public abstract void initData();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }
}
